import zyRequest from '@/api/'
import { IDataType } from '../types'

enum UserAPI {
  CreateProject = '/investors',
  GetProjectList = 'investors/list',
  DelelteProject = '/investors',
  EditPageData = '/investors',
  SearchProject = '/investors/list',
  GetProject = '/investors',
}
export function createProject(formData: any) {
  return zyRequest.post<IDataType>({
    url: UserAPI.CreateProject,
    data: formData,
  })
}

export function getProjectList(queryInfo: any) {
  return zyRequest.post<IDataType>({
    url: UserAPI.GetProjectList,
    data: queryInfo,
  })
}

export function deleteProject(id: string) {
  return zyRequest.delete<IDataType>({
    url: `${UserAPI.DelelteProject}/${id}`,
  })
}

export function editProject(id: string, data: any) {
  return zyRequest.post<IDataType>({
    url: `${UserAPI.DelelteProject}/${id}`,
    data: data,
  })
}

export function getProjectById(id: string) {
  return zyRequest.get<IDataType>({
    url: `${UserAPI.GetProject}/${id}`,
  })
}
